package com.jld.managerialsystemforcovid19.controller;

import com.jld.managerialsystemforcovid19.entity.Covid19GlobalData;
import com.jld.managerialsystemforcovid19.service.GlobalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class GlobalController {
    @Autowired
    private GlobalService globalService;
    //跳转全球疫情地图
    @RequestMapping("/toGlobal")
    public String toGlobal() {
        return "global";
    }

    @RequestMapping("/queryGlobal")
    @ResponseBody
    public List<Covid19GlobalData> queryGlobalData(){
        List<Covid19GlobalData> list = globalService.list();
        return list;
    }
}
